package practice09;

public class Student extends Person{

    private String name;
    private int age;
    private int id;
    private Klass klass;

    public String introduce(){
        if (klass.getLeader() != null && klass.getLeader().getName() == "Tom") {
            return super.introduce() + " I am a Student. I am Leader of Class " + klass.getNumber() + ".";
        } else {
            return super.introduce() + " I am a Student. I am at Class " + klass.getNumber() + ".";
        }
    }

    public Student(int id, String name, int age) {
        super(id, name, age);
    }

    public Student(int id, String name, int age, Klass klass) {
        super(id, name, age);
        this.klass = klass;
    }

    @Override
    public String getName() {
        return super.getName();
    }


    @Override
    public int getAge() {
        return super.getAge();
    }


    @Override
    public int getId() {
        return super.getId();
    }


    public Klass getKlass() {
        return klass;
    }

    public void setKlass(Klass klass) {
        this.klass = klass;
    }
}
